import loadable from '@loadable/component'

const Portal = loadable(() => import(/* webpackChunkName: "Portal" */`@/pages/Portal`))
const Login = loadable(() => import(`@/pages/Login`))
const Register = loadable(() => import(`@/pages/Register`))
const Address = loadable(() => import(`@/pages/Address`))
const Home = loadable(() => import(`@/pages/Home`))
const Iframe = loadable(() => import(`@/pages/Iframe`))
const OrderInfo = loadable(() => import(`@/pages/OrderInfo`))
const OrderList = loadable(() => import(`@/pages/OrderList`))
const Setting = loadable(() => import(`@/pages/Setting`))
const Shopcategory = loadable(() => import(`@/pages/Shopcategory`))
const ShopInfo = loadable(() => import(`@/pages/ShopInfo`))
const ShopList = loadable(() => import(`@/pages/ShopList`))
const Upload = loadable(() => import(`@/pages/Upload`))
const UserInfo = loadable(() => import(`@/pages/UserInfo`))
const UserList = loadable(() => import(`@/pages/UserList`))
const FoodList = loadable(() => import(`@/pages/FoodList`))

export const rootRouter = [
    {
        path: "/portal",
        Component: Portal,
        exact: false,
    },
    {
        path: "/login",
        Component: Login,
        exact: false,
    },
    {
        path: "/register",
        Component: Register,
        exact: false,
    },
    {
        path: "/",
        Component: Login,
        exact: true,
    }
]

export const otherRouter = [
    {
        path: "/address",
        Component: Address,
        exact: false,
    },
    {
        path: "/home",
        Component: Home,
        exact: false,
    },
    {
        path: "/iframe",
        Component: Iframe,
        exact: false,
    },
    {
        path: "/orderinfo",
        Component: OrderInfo,
        exact: false,
    },
    {
        path: "/orderlist",
        Component: OrderList,
        exact: false,
    },
    {
        path: "/setting",
        Component: Setting,
        exact: false,
    },
    {
        path: "/shopcategory",
        Component: Shopcategory,
        exact: false,
    },
    {
        path: "/shopinfo",
        Component: ShopInfo,
        exact: false,
    },
    {
        path: "/shoplist",
        Component: ShopList,
        exact: false,
    },
    {
        path: "/upload",
        Component: Upload,
        exact: false,
    },
    {
        path: "/userinfo",
        Component: UserInfo,
        exact: false,
    },
    {
        path: "/userlist",
        Component: UserList,
        exact: false,
    },
    {
        path: '/foodlist',
        Component: FoodList,
        exact: false,
    }
]